

function addSensorbitCod(Blockly) {




    //  获取lm35温度
Blockly.Python.microbit_lm35 = function(block) {
    Blockly.Python.definitions_['import_microbit'] = 'from microbit import *';
      Blockly.Python.definitions_['import_lm35'] = 'from sensor import lm35';
      var dropdown_lm35Pin = this.getFieldValue('lm35Pin');
      Blockly.Python.definitions_['import_lm35Pin' + dropdown_lm35Pin] = 'lm35Port' + dropdown_lm35Pin + ' = ' + dropdown_lm35Pin;
    var code = "lm35.read_temps(lm35Port" + dropdown_lm35Pin + ")";
      return [code];
  }

    return Blockly;
}

module.exports = addSensorbitCod;

